package com.xci.sys.service;

import com.github.pagehelper.Page;
import com.xci.sys.dao.JobLogDao;
import com.xci.sys.entity.SysJobLog;
import com.xci.sys.filter.JobLogFilter;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;

/**
 * 定时任务日志服务
 */
@Service
public class JobLogService {
    @Resource
    private JobLogDao jobLogDao;//定时任务日志数据层对象

    /**
     * 新建定时任务日志
     * @param entity 定时任务日志对象
     */
    @Transactional(rollbackFor = Exception.class)
    public void insert(SysJobLog entity) {
        jobLogDao.insert(entity);
    }

    /**
     * 查询单个定时任务日志
     * @param id 定时任务日志主键
     * @return 返回定时任务日志对象
     */
    public SysJobLog selectById(@NotBlank(message = "请指定定时任务日志主键") String id) {
        return jobLogDao.selectById(id);
    }

    /**
     * 查询定时任务日志分页列表
     * @param filter 过滤条件对象
     * @return 返回定时任务日志分页列表
     */
    public Page<SysJobLog> selectPageList(JobLogFilter filter) {
        return jobLogDao.selectPageList(filter);
    }
}